
{% extends "content_base.html" %}
{% block content %}
<div id="content">
{% if content %}
{{ content }}
{% else %}
	{% if not post %}
		<h2>找不到这个网页！</h2>
	{% else %}
	        <div class="page-nav">
			  {% if navigation.next %}
				<span class="next-entries">
					<a href="/post/{{keyword}}/{{navigation.next}}/">Next Entries</a>
				</span>
				{% else %}
				<span class="next-entries"></span>
				{% endif %}	
				{% if navigation.previous %}
				<span class="previous-entries">
					<a href="/post/{{keyword}}/{{navigation.previous}}/">Previous Entries</a>
				</span>
				{% else %}
				<span class="previous-entries"></span>
				{% endif %}
			</div><!-- /page nav -->
		
	    <div class="post" id="{{ post.key }}">
	  	<div class="date"><span>{{post.published|datetz:"m"}}月</span>{{post.published|datetz:"d"}}</div>
		<div class="title">
	      <h2><a href="/post/{{ post.permalink }}.html" rel="bookmark" title="Permanent Link to {{ post.title }}">{{ post.title }}</a></h2>
	          <div class="postdata">
	       		<span class="category">{% for cat in post.categories %}<a href="/category/{{ cat.category_url}}/" title="查看全部..." rel="category tag">{{ cat.category_name }}</a>,{% endfor %}</span>
		        <span class="tag">{% for tag in post.get_tags %}<a href="/tag/{{tag.tag}}/" title="{{tag.tag}}" rel="category tag">{{tag.tag}}</a>,{% endfor %}</span>
		        <span class="comments">{% if post.comments_enabled %}<a href="/post/{{ post.permalink }}.html#comments" title="Comment on {{ post.title }}">{% if not post.num_comments %}发表评论{% else %}{{ post.num_comments }} 条评论{% endif %}</a>{% endif %}&nbsp;&nbsp;点击量:很多</span>
			  </div>
	          <div class="entry">
	            <p>{{ post.content|linebreaks }}</p>
	            <br />
	            {% if relatedpost %}
	            <strong>相关推荐：</strong>
	            <ul>
	            {% for post in relatedpost %}
	            	<li><a href="/post/{{ post.permalink }}.html">{{ post.title }}</a></li>
	            {% endfor %}
	            </ul>
	            {% endif %}
			  </div><!--/entry -->
		</div><!--/title -->
		
			  <!-- You can start editing here. -->
			{% if comments %}
				<h3 id="comments">{{comments.length}} Responses to &#8220;{{ post.title }}&#8221;</h3> 
				<ol class="commentlist">
				    {% for com in comments  %}
					<li{% if forloop.counter0|divisibleby:"2" %} class="alt"{% endif %} id="{{ com.key }}">
						<cite>{% if com.link %}<a href="{{ com.link }}" rel="external nofollow">{{ com.author }}</a>{% else %}{{ com.author }}{% endif %}</cite> Says:
						<br />
						<small class="commentmetadata"><a name="{{ com.key }}">{{com.date|datetz:"D Y/m/d H:i"}}</a> </small>
						<p>{{ com.text|linebreaks }}</p>
					</li>
					{% endfor %}
				</ol>
			{% endif %}
			{% if post.comments_enabled %}
			    <h3 id="respond">Leave a Reply</h3>
				<form action="/newcomment" method="post" id="commentform">
				{% if user %}
				<p><input type="text" name="authorName" id="authorName" value="{{ user.nickname }}" size="22" tabindex="1" />
				<label for="authorName"><strong>姓名</strong> (required)</label><a href="{{ logout_url }}" title="Log out of this account">  Logout &raquo;</a></p>
				<p><input type="text" name="authorMail" id="authorMail" value="{{ user.email }}" size="22" tabindex="2" />
				<label for="authorMail"><strong>邮件地址</strong> (required)</label></p>
				<p><input type="text" name="authorSite" id="authorSite" value="" size="22" tabindex="3" />
				<label for="authorSite"><strong>地址</strong></label></p>
				{% else %}
				<p><input type="text" name="authorName" id="authorName" value="" size="22" tabindex="1" />
				<label for="authorName"><strong>姓名</strong> (required)</label>  Logged in as <a href="/admin/">user !</a>. </p>
				<p><input type="text" name="authorMail" id="authorMail" value="" size="22" tabindex="2" />
				<label for="authorMail"><strong>邮件地址</strong> (required)</label></p>
				<p><input type="text" name="authorSite" id="authorSite" value="" size="22" tabindex="3" />
				<label for="authorSite"><strong>地址</strong></label></p>
				{% endif %}
				<p><textarea name="content" id="commentContent" cols="100%" rows="10" tabindex="5"></textarea></p>
				<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
				<input type="hidden" name="post_key" value="{{ post.key }}" />
				</p>
				</form>
			{% endif %}<!--/Comment enabled -->
		</div><!--/post -->
	{% endif %}
{% endif %}
  </div><!--/content -->
{% endblock %}